<!DOCTYPE html>
<html lang="zh-cn">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
	<meta name="renderer" content="webkit">
	<title></title>
	<link rel="stylesheet" href="__PUBLIC__/admin/css/pintuer.css">
	<link rel="stylesheet" href="__PUBLIC__/admin/css/admin.css">
	<script src="__PUBLIC__/admin/js/jquery.js"></script>
	<script src="__PUBLIC__/admin/js/pintuer.js"></script>


	<!---->
	<script src='__PUBLIC__/admin/assets/daterangepicker/js/jquery.js'></script>
	<script src="__PUBLIC__/admin/assets/js/jquery.js"></script>
	<!-- basic styles -->
	<link href="__PUBLIC__/admin/assets/css/bootstrap.min.css" rel="stylesheet"/>
	<link rel="stylesheet" href="__PUBLIC__/admin/assets/css/font-awesome.min.css"/>
	<!--[if IE 7]>
	<link rel="stylesheet" href="__PUBLIC__/admin/assets/css/font-awesome-ie7.min.css"/>
	<![endif]-->
	<!-- page specific plugin styles -->
	<link rel="stylesheet" href="__PUBLIC__/admin/assets/css/jquery-ui-1.10.3.full.min.css"/>

	<!-- ace styles -->

	<link rel="stylesheet" href="__PUBLIC__/admin/assets/css/ace.min.css"/>
	<link rel="stylesheet" href="__PUBLIC__/admin/assets/css/ace-rtl.min.css"/>
	<link rel="stylesheet" href="__PUBLIC__/admin/assets/css/ace-skins.min.css"/>

	<!--[if lte IE 8]>
	<link rel="stylesheet" href="__PUBLIC__/admin/assets/css/ace-ie.min.css"/>
	<![endif]-->

	<!--<link rel="stylesheet" href="__PUBLIC__/assets/css/pagination.css" />-->
	<!--日期区间-->
	<!--<link rel="stylesheet" href="__PUBLIC__/assets/daterangepicker/css/bootstrap.css" />-->
	<link rel="stylesheet" href="__PUBLIC__/admin/assets/daterangepicker/css/font-awesome.css"/>
	<link rel="stylesheet" href="__PUBLIC__/admin/assets/daterangepicker/css/daterangepicker.css"/>
	<!--日期区间-->
	<link rel="stylesheet" href="__PUBLIC__/admin/assets/css/datepicker.css"/>

	<!-- inline styles related to this page -->

	<!-- ace settings handler -->

	<script src="__PUBLIC__/admin/assets/js/ace-extra.min.js"></script>

	<!--日期区间-->
	<script src='__PUBLIC__/admin/assets/daterangepicker/js/common.js'></script>
	<script src="__PUBLIC__/admin/assets/daterangepicker/js/date-time/moment.js?ver=1" type="text/javascript"></script>
	<script src="__PUBLIC__/admin/assets/daterangepicker/js/date-time/daterangepicker.zh-CN.js?ver=1"
			type="text/javascript"></script>
	<script src="__PUBLIC__/admin/assets/daterangepicker/js/date-time/daterangepicker.js?ver=1"
			type="text/javascript"></script>
	<!--日期区间-->
	<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->

</head>
<body>

<div class="widget-body">
	<div class="widget-body-inner" style="display: block;">
		<div class="widget-main">
			<form id="querydata" action="showOrder" method="post">
				<div class="input-group" style="width: 300px;">
					<span class="input-group-addon">
						查询日期
					</span>
					<if condition="!isset($_SESSION['beginTime'])">
						<input class="form-control date-picker" id="dateTimeRange" value="" type="text">
						<else />
						<input class="form-control date-picker" id="dateTimeRange" value="{$Think.session.beginTime} 至{$Think.session.endTime}" type="text">
					</if>

					<span class="input-group-addon">
						<i class="fa fa-calendar bigger-110"></i>
					</span>
					<input name="beginTime" id="beginTime" value="{$Think.session.beginTime}" type="hidden">
					<input name="endTime" id="endTime" value="{$Think.session.endTime}" type="hidden">
					<!--<a href="javascript:;" onclick="begin_end_time_clear();">清除</a>-->
				</div>
				<hr/>
				<label>订单号</label>
				<input id="orderId" value="{$Think.session.orderId}" name="orderId" type="text"/>
				&nbsp;&nbsp;
				<label>用户名</label>
				<input id="userName" value="{$Think.session.userName}" name="userName" type="text"/>
				&nbsp;&nbsp;
				<label>桌号</label>
				<input id="tableNum" value="{$Think.session.tableNum}" name="tableNum" type="text"/>
				&nbsp;&nbsp;
				<input type="button" value="查询" onclick="querydata();"/>
				<input type="button" value="清空" onclick="begin_end_time_clear();"/>
			</form>

		</div>
	</div>
</div>
</div>




		<table class="table table-hover text-center">
			<tr>
				<th>订单ID</th>
				<th>用户名</th>
				<th>联系电话</th>
				<th>总价</th>
				<th>桌号</th>
				<th>数量</th>
				<th>创建时间</th>
			</tr>
			<foreach name="order" item="vo" >
				<tr>
					<td>{$vo.order_id}</td>
					<td>{$vo.user_name}</td>
					<td>{$vo.user_contact}</td>
					<td>{$vo.price}</td>
					<td>{$vo.table_num}</td>
					<td>{$vo.item_count}</td>
					<td>{$vo.create_time}</td>
				</tr>
			</foreach>
			<tr>
				<td colspan="8"><div class="pagelist"> {$page} </div></td>
			</tr>
		</table>
</body>




<script type="text/javascript">
	$(function () {
		$('#dateTimeRange').daterangepicker({
					applyClass: 'btn-sm btn-success',
					cancelClass: 'btn-sm btn-default',
					locale: {
						applyLabel: '确认',
						cancelLabel: '取消',
						fromLabel: '起始时间',
						toLabel: '结束时间',
						customRangeLabel: '自定义',
						firstDay: 1
					},
					ranges: {
						//'最近1小时': [moment().subtract('hours',1), moment()],
						'今日': [moment().startOf('day'), moment()],
						'昨日': [moment().subtract('days', 1).startOf('day'), moment().subtract('days', 1).endOf('day')],
						'最近7日': [moment().subtract('days', 6), moment()],
						'最近30日': [moment().subtract('days', 29), moment()],
						'本月': [moment().startOf("month"), moment().endOf("month")],
						'上个月': [moment().subtract(1, "month").startOf("month"), moment().subtract(1, "month").endOf("month")]
					},
					opens: 'right',	// 日期选择框的弹出位置
					separator: ' 至 ',
					showWeekNumbers: true,		// 是否显示第几周


					//timePicker: true,
					//timePickerIncrement : 10,	// 时间的增量，单位为分钟
					//timePicker12Hour : false,	// 是否使用12小时制来显示时间


					//maxDate : moment(),			// 最大时间
					format: 'YYYY-MM-DD'

				}, function (start, end, label) { // 格式化日期显示框
					$('#beginTime').val(start.format('YYYY-MM-DD'));
					$('#endTime').val(end.format('YYYY-MM-DD'));
				})
				.next().on('click', function () {
			$(this).prev().focus();
		});
	});

	/**
	 * 清除时间
	 */
	function begin_end_time_clear() {
		$('#dateTimeRange').val('');
		$('#beginTime').val('');
		$('#endTime').val('');

		$('#orderId').val('');
		$('#useerName').val('');
		$('#tableNum').val('');
	}

	function querydata() {
		$("#querydata").submit();
//			alert("1！");
	/*	if ($('#dateTimeRange').val() == "") {
			alert("请输入查询的日期范围！");
		} else {

//			window.location.href="http://localhost:81/luyan/admin.php/Index/showjqgriddata";
//			$("#querydata").submit();

		}*/

	}

</script>

</html>